﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace GestionnaireTUPleiade
{
    public partial class FormCheminDLLMetier : Form
    {
        private Core _core = Core.GetInstance();
        
        public FormCheminDLLMetier()
        {
            InitializeComponent();
        }

        private void btnModifyPath_Click(object sender, EventArgs e)
        {
            folderBrowserDialog1.SelectedPath = tbBusinessDLLpath.Text;
            if (folderBrowserDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                tbBusinessDLLpath.Text = folderBrowserDialog1.SelectedPath;    
        }

        private void FormCheminDLLMetier_Load(object sender, EventArgs e)
        {
            tbBusinessDLLpath.Text = _core.GetBusinessAssemblyPath();
            tbTestDLLPath.Text = _core.GetTestsAssemblyPath();
            tbUTClasses.Text = _core.GetUTClassesPath();
            tbXML.Text = _core.GetxmlPath();
        }

        private void btnVal_Click(object sender, EventArgs e)
        {
            _core.SetBusinessAssemblyPath(tbBusinessDLLpath.Text);
        }

        private void btnModifyPathTests_Click(object sender, EventArgs e)
        {
            folderBrowserDialog1.SelectedPath = tbTestDLLPath.Text;
            if (folderBrowserDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                tbTestDLLPath.Text = folderBrowserDialog1.SelectedPath;    
        }

        private void btnValTests_Click(object sender, EventArgs e)
        {
            _core.SetUTClassesPath(tbTestDLLPath.Text);
        }

        private void btnModifyXML_Click(object sender, EventArgs e)
        {
            folderBrowserDialog1.SelectedPath = tbXML.Text;
            if (folderBrowserDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                tbXML.Text = folderBrowserDialog1.SelectedPath;    
        }

        private void btnValXML_Click(object sender, EventArgs e)
        {
            _core.SetxmlPath(tbXML.Text);
        }

        private void btnModifyUTClasses_Click(object sender, EventArgs e)
        {
            folderBrowserDialog1.SelectedPath = tbUTClasses.Text;
            if (folderBrowserDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                tbUTClasses.Text = folderBrowserDialog1.SelectedPath;    
        }

        private void btnValUTClasses_Click(object sender, EventArgs e)
        {
            _core.SetUTClassesPath(tbUTClasses.Text);
        }
    }
}
